const app = getApp();
var config = app.globalData.config;
const http = require('../../utils/http.js');
Page({
	data: {
		background: ['demo-text-1', 'demo-text-2', 'demo-text-3'],
		indicatorDots: true,
		vertical: false,
		autoplay: false,
		interval: 2000,
    duration: 500,
    enroll_apply_on: 1,
    food_apply_on: 1
	},
	onReady: function() {
		if (!app.login()) {
			return;
		}
		
		var _group_id = app.globalData.userInfo.group_id;
		console.log(_group_id);
		if(_group_id==2){
			wx.reLaunch({
				url: '../../teacher/index/tindex',
			})
    }
    
    var that = this;
		http.httpPost(config.get_index_configs, {}, function(e) {
      
			that.setData({
        enroll_apply_on : e.data.enroll_apply,
        food_apply_on : e.data.food_apply
			});
		});
		
	},
	onLoad: function(options) {
		var that = this;
		var userInfo = app.globalData.userInfo;
		// console.log(userInfo)
		// http.httpPost(config.test, {
		// 	cat: 1
		// }, function(e) {
		// 	console.log(e)
		// 	that.setData({
		// 		data: e.data
		// 	})
		// })
  },
  goUrl(e){//跳转链接
    var _url = e.currentTarget.dataset.turl;
    console.log(_url)
    wx.navigateTo({
      url: _url,
    })
  },
	developmentFun(){
		wx.showToast({
			title: "开发中",
			icon: 'none',
			duration: 1000,
			mask: true
		});
	}

})
